export default function thousandBitSeparator(num) {
  if (!num) {
    return 0;
  } else {
    return (num
      .toString().indexOf('.') != -1 ? num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) {
        return $1 + ",";
      }) : num.toString().replace(/(\d)(?=(\d{3})+$)/g, function($0, $1) {
        return $1 + ",";
      }));
  }
}
